import request from '@/utils/request'

/**
* 煤场环境监测设备表分页查询
* @param {查询条件} data
*/
export function listSystemDeviceTEnvmonitor(query: any) {
  return request({
    url: 'business/SystemDeviceTEnvmonitor/list',
    method: 'get',
    params: query,
  })
}
/*查询煤场数据*/
export function getAllBunkerData() {
  return request({
    url: 'business/FuelBunkerTRecord/GetAllBunkerData',
    method: 'get'
  })
}

/**
* 新增煤场环境监测设备表
* @param data
*/
export function addSystemDeviceTEnvmonitor(data: any) {
  return request({
    url: 'business/SystemDeviceTEnvmonitor',
    method: 'post',
    data: data,
  })
}

/**
* 修改煤场环境监测设备表
* @param data
*/
export function updateSystemDeviceTEnvmonitor(data: any) {
  return request({
    url: 'business/SystemDeviceTEnvmonitor',
    method: 'PUT',
    data: data,
  })
}

/**
* 获取煤场环境监测设备表详情
* @param {Id}
*/
export function getSystemDeviceTEnvmonitor(id: string) {
  return request({
    url: 'business/SystemDeviceTEnvmonitor/' + id,
    method: 'get'
  })
}

/**
* 获取煤场环境监测设备表详情
* @param {Id}
*/
export function getDeviceDataByBunkerAndType(bunkerId: string,deviceType: string) {
  return request({
    url: 'business/SystemDeviceTEnvmonitor/getDeviceDataByBunkerAndType?bunkerId=' + bunkerId + "&deviceType=" + deviceType,
    method: 'get'
  })
}


export function getBunkerEnvmonitor(deviceType: string) {
  return request({
    url: 'business/SystemDeviceTEnvmonitor/bunkerenvmonitor?deviceType=' + deviceType,
    method: 'get'
  })
}


export function getDeviceValue(data: any) {
  return request({
    url: 'business/SystemDeviceTEnvmonitor/getDeviceValue',
    method: 'post',
    data: data,
  })
}

// export function getDeviceValue(bunkerId) {
//   return request({
//     url: 'business/SystemDeviceTEnvmonitor/getDeviceValue',
//     method: 'post',
//     data: data,
//   })
// }


/**
* 删除煤场环境监测设备表
* @param {主键} pid
*/
export function delSystemDeviceTEnvmonitor(pid: string) {
  return request({
    url: 'business/SystemDeviceTEnvmonitor/' + pid,
    method: 'delete'
  })
}

// 清空煤场环境监测设备表
export function clearSystemDeviceTEnvmonitor() {
  return request({
    url: 'business/SystemDeviceTEnvmonitor/clean',
    method: 'delete'
  })
}

// 导出煤场环境监测设备表
export async function exportSystemDeviceTEnvmonitor(query: any) {
  // await downFile('business/SystemDeviceTEnvmonitor/export', { ...query })
}

